#include <stdio.h>
#define N 10
struct worker{
    char name[20];
    float dailySalary;
    int days;
    float totalSalary;
};
int main()
{
    struct worker workers[N];
    struct worker worker;
    for( int i = 0; i<N; i ++){
        scanf("%s %f %d", workers[i].name, &workers[i].dailySalary, &workers[i].days );
        workers[i].totalSalary = workers[i].dailySalary * workers[i].days;
    }
    for( int i = 0; i < N; i ++){
        int k = i;
        for( int j = i + 1; j < N; j ++)
            if( workers[k].totalSalary < workers[j].totalSalary)
                k = j;
        if(k != i){
            worker = workers[k];
            workers[k] = workers[i];
            workers[i] = worker;
        }
    }
    for( int i = 0; i<N; i ++)
        printf("%s %.2f %d %.2f\n", workers[i].name, workers[i].dailySalary, workers[i].days, workers[i].totalSalary );
    return 0;
}